
<style>
    .event-info{
        padding: 20px;
    }
    .event-info .event-info-time-p{
        font-size: 12px;
        color: #818181;
        /* font-weight: bold; */
    }

    .event-info .event-info-time-p-span-title{
        font-size: 17px;
        font-weight: bold;
        color: #727272;
    }
    .event-info .event-info-time-p-span-content{
        /* font-weight: bold; */
        color: #727272;
        font-family: 微软雅黑;
    }
    
    .event-info fieldset legend{
        font-size: 12px;
        font-weight: 400;
        color: #a5a3a3;
        margin: auto;
        
    }
</style>
<script type="text/html" id="tpl-event_info">
    <div class="event-info">
        <p><span class="event-info-time-p-span-title">{{d.title}}</span></p>
        <br>        
        <p class="event-info-time-p">时间： <span>{{d.start_time}} ~ {{d.end_time}}</span></p>
        <hr>
        <p><span ><pre class="event-info-time-p-span-content">{{d.content}}</pre></span></p>
        <fieldset class="layui-elem-field layui-field-title">
            <legend>创建于 {{d.create_time}}</legend>
            <!-- <div class="layui-field-box"> </div> -->
        </fieldset>
        
    </div>
</script>
<script type="text/javascript">
    app.base.loadApi(['apiObject','apiLogin','apiUser']);
    app.defTpl('eventInfo', function (tplArg) {
        layui.use(['layer', 'laytpl','apiObject','apiLogin','dropdown','apiUser'], function () {
            var laytpl = layui.laytpl, $ = layui.$;

            // laytpl($('#tpl-file_tool_objlist').html()).render({}, function (html) {
            //     $(tplArg.elem).html(html)
            // })
            var d={}
            d.title= tplArg.title? tplArg.title:"（无标题）";
            d.start_time= tplArg.start_time? tplArg.start_time:"";
            if(tplArg.start_time && tplArg.end_time && tplArg.end_time.slice(0,10)== tplArg.start_time.slice(0, 10)){
                d.end_time = tplArg.end_time.slice(11);
            }else{
                d.end_time = tplArg.end_time ? tplArg.end_time : "";
            }
            d.create_time = tplArg.create_time ? tplArg.create_time : "";
            d.content = tplArg.content ? tplArg.content : "";

            app.base.tplRender('#tpl-event_info', d,null,function(html){
                app.base.layer({
                    title: "事件详情",
                    type: 1,
                    shadeClose:true,
                    skin: "tpl-objectSetting",
                    area: ['440px', '500px'], //宽高
                    content: html,
                    buttons: [
                        {
                            title: "编辑",
                            onClick: function (layerIndex) {
                                if(tplArg.onEditClick) tplArg.onEditClick(layerIndex);
                                return false;
                            }
                        },
                    ],
                    success: function () {
                    }
                })
            })

            
            




        })
    })

</script>